#include  <cstdio>
#include  <limits.h>

int main(int argc, char *argv[])
{
	int n;
	int pre,d,x,sum = 0,min = INT_MAX;
	scanf("%d",&n);
	for( int i = 1; i < n ; ++i )
	{
		scanf("%d",&d);
		int dif = d - sum;
		sum = d;
		if(i != 1 && i != n-1 && dif < min)
		{
			min = dif;
			x = i;
		}
	}
	if( n < 4)
	{
		printf("0\n");
		return 0;
	}
	printf("%d\n",sum+min);
	printf("%d %d %d %d\n",x+1,1,n,x);
}
